This is the complete scene code for the scene titled “Creature Room.” It is followed by a breakdown of the code into sections, with explanations of each section.
PRINT{Your bullet just bounces off the roach's thick exoskeleton!}
PRINT{The Big Mama Roach snaps her mandibles at you!}
IF{RANDOM#>35}THEN
SOUND{SMACK}
PRINT{A hit! The razor sharp pincers tear your flesh!}
LET{PHYS.HIT.CUR#=PHYS.HIT.CUR#-40}
EXIT
SOUND{SWISH}
PRINT{A miss!}
EXIT
SOUND{SMACK}
PRINT{Your attack fails! The blasted bug's exoskeleton is too tough!}
PRINT{The Big Mama Roach snaps her mandibles at you!}
IF{RANDOM#>15}THEN
SOUND{SMACK}
PRINT{A hit! The razor sharp pincers tear your flesh!}
LET{PHYS.HIT.CUR#=PHYS.HIT.CUR#-45}
EXIT
SOUND{SWISH}
PRINT{A miss!}
EXIT
END
IF{TEXT$=TALK}THEN
PRINT{...................................}
IF{ROACH.1=SCENE@}THEN
PRINT{BIG MAMA: "The only thing I have to say is, 'Die, soft one!'"}
EXIT
IF{COCKROACH=SCENE@}THEN
PRINT{It's just a little cockroach, it can't talk.}
EXIT
END
IF{TEXT$=GIVE}OR{TEXT$=OFFER}THEN
PRINT{...................................}
IF{ROACH.1=SCENE@}THEN
IF{TEXT$=CLIPPING}OR{TEXT$=AD}THEN
IF{CLIPPING>PLAYER@}THEN
PRINT{You don't have the clipping.}
EXIT
MOVE{CLIPPING}TO{STORAGE@}
MOVE{PHONE.1}TO{SCENE@}
PRINT{The Roach takes the clipping and reads it eagerly, then whips out a cellular phone.}
PRINT{BIG MAMA: "Hello, Mr. Shapiro? About that job... you bet I'm qualified... yeah, let's do lunch."}
SOUND{TONES.2}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
PRINT{BIG MAMA: "This is your lucky day, human. I was born for a job like that! See ya on CNN, baby!"}
MOVE{PHONE.1}TO{STORAGE@}
MOVE{ROACH.1}TO{STORAGE@}
PRINT{The Big Mama Roach puts away the phone, grabs her briefcase and Armani suit, and leaves.}
EXIT
PRINT{BIG MAMA: "Your pathetic offerings mean nothing to me, soft one! Only your death will bring me joy!"}
EXIT
END
IF{TEXT$=SEARCH}THEN
PRINT{...................................}
IF{COCKROACH=SCENE@}THEN
PRINT{The cockroach is a Character. It is a simple creature, capable of limited behavior such as fighting or running, and it's very weak and easy to kill.}
PRINT{This makes it perfect to use as a Character. A more complex creature should be an Object.}
EXIT
END
****************End of code***********************
In this scene, there is a small cockroach on the floor when the player first comes into the room. The player cannot reach the monitor and button on the other side of the room while the cockroach is there, so he must first kill the cockroach. The cockroach is an actual Character. After the cockroach is killed, a giant roach appears in a puff of smoke. The giant roach is an Object, and it too must be defeated by giving it a newspaper clipping before the player can reach the important objects across the room.
After the giant roach is gone, the player can turn on the monitor, which shows a picture of a rocket. When the player enters the magic word while the rocket is visible, a secret doorway opens, revealing stairs that go up to the next room.
The code below handles the scene description, which changes depending on the circumstances in the scene:
IF{LOOP#=0}OR{TEXT$=LOOK}THEN
PRINT{You are in an empty room. There is a large screen of some sort on the far wall. The exit is NORTH.}
IF{STAIRS.2>SCENE@}THEN
PRINT{...................................}
PRINT{There is a stairway going UP.}
END
PRINT{...................................}
PRINT{You are facing SOUTH.}
IF{ROACH.1=SCENE@}THEN
PRINT{...................................}
PRINT{There is a Big Mama Roach in the middle of the room!}
PRINT{The Big Mama Roach is an Object. Its actions, and your interaction with it, are controlled by the scene code.}
END
END
>>>The first statement in the code above is true if the player has just come into the scene, or has entered the word “look.” If either condition is true, then some text is printed that provides a basic description of the scene. Then a nested statement determines if the secret staircase is visible, and if so, prints some more text describing that. “STAIRS.2” is an object that hides the secret staircase. If it is not in the scene, then the staircase is visible.
Next, some text is printed to tell the player which direction he is facing. Following that is another nested statement that checks to see if the giant roach, ROACH.1, is in the scene. If so, then additional text is printed describing it.
All the statements in the section above close with END, so that the game will automatically tell the player if any dropped mobile objects are in the scene.<<<
The code below creates the giant roach’s grand entrance:
IF{R1#<1}AND{COCKROACH>SCENE@}THEN
PRINT{...................................}
LET{R1#=1}
SOUND{WOOSH.1}
MOVE{SMOKE.1}TO{SCENE@}
MOVE{SMOKE.2}TO{SCENE@}
MOVE{SMOKE.1}TO{STORAGE@}
MOVE{SMOKE.3}TO{SCENE@}
MOVE{SMOKE.2}TO{STORAGE@}
MOVE{SMOKE.4}TO{SCENE@}
MOVE{SMOKE.3}TO{STORAGE@}
MOVE{ROACH.1}TO{SCENE@}
MOVE{SMOKE.4}TO{STORAGE@}
PRINT{Suddenly a Big Mama Roach appears in a flash of fire and smoke, and she looks pissed!}
PRINT{BIG MAMA: "You'll pay for the way you treated my baby, human scum!"}
SOUND{ROAR}
EXIT
>>>The statement above test for two conditions. First, if variable R1# is less than one, and second, if the “cockroach” Character is not in the scene. One the player has killed the cockroach, then the very next move the player makes will cause both conditions in this statement to be true, and the statement will be executed. Variable R1# is set to one, making it impossible for the giant roach to make more than one entrance. The a sound is player, and four objects are moved to the scene one by one. Each of the SMOKE objects is a drawing that depeicts various stages of a billowing mushroom cloud of smoke. SMOKE.1 is moved to the scene first, then SMOKE.2 is moved to the scene, and SMOKE.1 is returned to storage. Then SMOKE.3 is moved to the scene, and SMOKE.2 is returned to storage. Then SMOKE.4 is moved to the scene, and SMOKE.3 is returned to storage. Finally, the giant roach, ROACH.1, is moved to the scene, and SMOKE.4 is returned to storage. Some text is printed to tell the player what just happened. The entire statement closes with EXIT, since we don’t want anything else to happen, including the move the player just made that triggered this action.<<<
The short statement below prints a line of periods before the object descriptions, when any of the immobile objects in the scene are clicked:
Since the player isn’t allowed to operate the monitor on the far wall while the cockroach or the giant roach are in the scene, the special code below tests for those conditions when the player clicks on the monitor or the button that turns it on:
IF{CLICK$=SCREEN.}OR{CLICK$=CREATURE.BUTTON}THEN
IF{COCKROACH=SCENE@}THEN
PRINT{You can't reach it, the cockroach is blocking the way.}
EXIT
IF{ROACH.1=SCENE@}THEN
PRINT{You can't reach it, the Big Mama Roach blocks the way.}
EXIT
IF{CLICK$=CREATURE.BUTTON}THEN
MOVE{CREATURE.BUTTON}TO{STORAGE@}
SOUND{BUTTON-SND.1}
MOVE{CREATURE.BUTTON}TO{SCENE@}
IF{SCREEN.2=SCENE@}THEN
MOVE{SCREEN.2}TO{STORAGE@}
PRINT{The monitor displays a picture of a rocket.}
EXIT
EXIT
END
>>>The first statement (above) detects mouse clicks on the monitor (SCREEN.1) and the monitor button (CREATURE.BUTTON). If either of these objects has been clicked, then a nested statement determines if the “cockroach” Character is in the scene. If so, then text is printed telling the player that he can’t reach that object because the cockroach is blocking the way. The statement closes with EXIT, to stop the program before the mouse click can trigger any other actions. If the cockroach is not in the scene, that statement is skipped.
The second nested statement detects the presence of the ROACH.1 object, the “Big Mama Roach.” If ROACH.1 is in the scene, text is printed telling the player that he can’t reach the object because the “Big Mama” roach is blocking the way. This statement also closes with EXIT to prevent any further action.
If neither the cockroach or the ROACH.1 object are in the scene, both statements are ignored and the program can continue to handle the mouse clicks normally. One more nested statement detects clicks on the CREATURE.BUTTON. If that object has been clicked, then the monitor will be turned on, or turned off, depending on it’s current condition. The innermost statement determines whether the monitor is off, and if so, turns it on by moving the darkened screen image (SCREEN.2) to storage. If SCREEN.2 is already in storage, it will then be moved back to the scene, to create the effect of the monitor being turned off.<<<
The magic word is HAKO, which the player can deduce from clues provided in the game. If the player enters this word while the rocket is visible on the monitor, a secret door opens, revealing the staircase. If the door is already open, using the magic word will close it:
IF{TEXT$=HAKO}THEN
PRINT{...................................}
IF{SCREEN.2>SCENE@}THEN
SOUND{BOING}
IF{STAIRS.2=SCENE@}THEN
MOVE{STAIRS.2}TO{STORAGE@}
PRINT{A passage suddenly appears in the wall! There is a stairway leading UP.}
EXIT
MOVE{STAIRS.2}TO{SCENE@}
PRINT{The stairway is hidden once again.}
EXIT
END
>>>The first statement (above) detects entry of the word “HAKO.” Since the word is only effective when the rocket is visible, a nested statement checks to see if object SCREEN.2 is not in the scene, which means the monitor is on and the rocket is visible. If this is the case, then a magic sound is played, and another statement checks to see if the Object STAIRS.2 is in the scene. If so, then STAIRS.2 is moved to storage, and text is printed telling the player that a secret stairway has opened up. If STAIRS.2 is already in storage, then it is returned to the scene, hiding the stairway once again. The original “HAKO” statement closes with END, so if the rocket is not visible, the program will continue until it reachs the default “HAKO” statement in the Global code.<<<
The next statement controls the player’s movement when he enters the word “UP.” If the stairway is visible, the player is moved to the next scene, titled “Toll Booth.” If the stairway is NOT visible, the inner statement is ignored, and the statement closes with END, allowing the program to reach the default in the Global code, “You can’t go up here.”
IF{TEXT$=UP}THEN
IF{STAIRS.2>SCENE@}THEN
MOVE{PLAYER@}TO{TOLL BOOTH}
EXIT
END
Since the “Big Mama” roach is an Object, not a Character, attacks against it must be dealt with in the scene code. The following section of code handles any attempt to attack the roach:
PRINT{Your bullet just bounces off the roach's thick exoskeleton!}
PRINT{The Big Mama Roach snaps her mandibles at you!}
IF{RANDOM#>35}THEN
SOUND{SMACK}
PRINT{A hit! The razor sharp pincers tear your flesh!}
LET{PHYS.HIT.CUR#=PHYS.HIT.CUR#-40}
EXIT
SOUND{SWISH}
PRINT{A miss!}
EXIT
SOUND{SMACK}
PRINT{Your attack fails! The blasted bug's exoskeleton is too tough!}
PRINT{The Big Mama Roach snaps her mandibles at you!}
IF{RANDOM#>15}THEN
SOUND{SMACK}
PRINT{A hit! The razor sharp pincers tear your flesh!}
LET{PHYS.HIT.CUR#=PHYS.HIT.CUR#-45}
EXIT
SOUND{SWISH}
PRINT{A miss!}
EXIT
END
>>>The first statement (above) detects the entry of any words associated with an attack, such as shoot, fire (as in “fire pistol”), or swing (as in “swing fist). If any of these words are entered, then a nested statement determines whether ROACH.1 is in the scene. If so, then another statement is used to weed out other attack verbs, testing for those that involve a gun: “shoot” and “fire.” If either of these is used, then another nested statement checks to see if the player has the pistol, and if not, text is printed telling him that he doesn’t have a gun. If he does have the pistol, that statement is skipped, and a gunshot sound is played, followed by the roar of the killer roach. Text is printed telling the player that his shot has failed to penetrate the bug’s thick exoskeleton. Next, the roach’s counter-attack takes place. A statement creates a random number between 1 and 100. If the number is greater than 35, the bug’s attack is successful, and the player’s current physical hit points are reduced. The variable that represents the player’s current physical hit points is PHYS.HIT.CUR#
If the random number not greater than 35, then the roach’s attack is a miss, and text is printed telling the player this.
If the player has attacked using anything other than the pistol, the “shoot/fire” statement is ignored, and text is printed telling the player that his attack has failed. Then the roach’s counter-attack code is executed. It is the same counter-attack code that was used in the “shooting” attack, but with a higher damage to the player’s hit points. As before, a random number is selected, and if it is higher than 15, the bug’s counter-attack strikes the player. (Since the player is attacking with hand weapons instead of a gun, the probability of being hit by a counter-attack is higher.) If the random number is not greater than 15, then the bug’s attack has missed.
The beginning “attack” statement closes with END. If the ROACH.1 object is not in the scene, all the nested statements are ignored, and the program handles any of the attack verbs normally.<<<
Next, the code below handles any attempt the player might make to talk to either the “Big Mama” roach or the cockroach:
IF{TEXT$=TALK}THEN
PRINT{...................................}
IF{ROACH.1=SCENE@}THEN
PRINT{BIG MAMA: "The only thing I have to say is, 'Die, soft one!'"}
EXIT
IF{COCKROACH=SCENE@}THEN
PRINT{It's just a little cockroach, it can't talk.}
EXIT
END
The code below handles any attempt the player makes to give things to the “Big Mama” roach. (Since the cockroach is an actual Character, offerings to it are handled automatically by the program.) If the player offers the clipping to the giant roach, it reads the clipping, calls the number on the ad, and leaves to accept the job advertised in the clipping. Anything else that is offered to the giant roach is harshly rejected:
IF{TEXT$=GIVE}OR{TEXT$=OFFER}THEN
PRINT{...................................}
IF{ROACH.1=SCENE@}THEN
IF{TEXT$=CLIPPING}OR{TEXT$=AD}THEN
IF{CLIPPING>PLAYER@}THEN
PRINT{You don't have the clipping.}
EXIT
MOVE{CLIPPING}TO{STORAGE@}
MOVE{PHONE.1}TO{SCENE@}
PRINT{The Roach takes the clipping and reads it eagerly, then whips out a cellular phone.}
PRINT{BIG MAMA: "Hello, Mr. Shapiro? About that job... you bet I'm qualified... yeah, let's do lunch."}
SOUND{TONES.2}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
SOUND{SILENCE.1}
PRINT{BIG MAMA: "This is your lucky day, human. I was born for a job like that! See ya on CNN, baby!"}
MOVE{PHONE.1}TO{STORAGE@}
MOVE{ROACH.1}TO{STORAGE@}
PRINT{The Big Mama Roach puts away the phone, grabs her briefcase and Armani suit, and leaves.}
EXIT
PRINT{BIG MAMA: "Your pathetic offerings mean nothing to me, soft one! Only your death will bring me joy!"}
EXIT
END
>>>The first statement (above) tests for entry of the words “give” or “offer.” If either of these words has been entered, then a nested statement tests for the presence of the object ROACH.1 in the scene. If the player makes an offer, and ROACH.1 is in the scene, then a nested statement checks to see if the player has also entered the word “clipping.” If this is true, then a statement checks to see if the player has the clipping, and if not, text is printed telling him that he doesn’t have the clipping. If the player has the clipping, that statement is ignored and rest of the “clipping” statement is executed. The clipping is moved to storage, and an object called PHONE.1 is moved to the scene. This object is a drawing of a cellular phone, positioned to appear in the roach’s hand, along with a drawing of the clipping in its other hand. A bit of text is printed, then a dialing sound is played. This is followed by a sound that is just a half second of silence. The silent sound is repeated several times. The purpose of this is to “pause” the animation long enough for the player to see what has happened, and to read the text. Finally, text is printed explaining that the roach is leaving to take the job, and PHONE.1 and ROACH.1 are both moved to storage.
If the player has entered the word “give” or “offer” but is offering anything else besides the clipping, then the entire “clipping” statement is ignored. Text is printed indicating that the roach has rejected the player’s offering.
If the object ROACH.1 is not in the scene, all of the nested statements are skipped, and the “give/offer” statement closes with END, allowing the program to handle it normally.<<<
The last section of code detects entry of the “search” command. A nested statement detects if the cockroach is in the scene, and if so, some text is displayed that explains the Character to the player. If the cockroach is not in the scene, the nested statement is skipped, and the “search” statement closes with END, so that the program will continue until it reaches the default ‘search” statement in the Global code:
IF{TEXT$=SEARCH}THEN
PRINT{...................................}
IF{COCKROACH=SCENE@}THEN
PRINT{The cockroach is a Character. It is a simple creature, capable of limited behavior such as fighting or running, and it's very weak and easy to kill.}
PRINT{This makes it perfect to use as a Character. A more complex creature should be an Object.}